package com.jianbing.shasha.service.impl;

import java.util.List;

import com.jianbing.shasha.domain.ShashaRewardNameUrlCount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jianbing.shasha.mapper.ShashaUserAchieveMapper;
import com.jianbing.shasha.domain.ShashaUserAchieve;
import com.jianbing.shasha.service.IShashaUserAchieveService;

/**
 * 用户获得奖励记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-09
 */
@Service
public class ShashaUserAchieveServiceImpl implements IShashaUserAchieveService 
{
    @Autowired
    private ShashaUserAchieveMapper shashaUserAchieveMapper;

    /**
     * 查询用户获得奖励记录
     * 
     * @param id 用户获得奖励记录主键
     * @return 用户获得奖励记录
     */
    @Override
    public ShashaUserAchieve selectShashaUserAchieveById(Long id)
    {
        return shashaUserAchieveMapper.selectShashaUserAchieveById(id);
    }

    /**
     * 查询用户获得奖励记录列表
     * 
     * @param shashaUserAchieve 用户获得奖励记录
     * @return 用户获得奖励记录
     */
    @Override
    public List<ShashaUserAchieve> selectShashaUserAchieveList(ShashaUserAchieve shashaUserAchieve)
    {
        return shashaUserAchieveMapper.selectShashaUserAchieveList(shashaUserAchieve);
    }

    /**
     * 新增用户获得奖励记录
     * 
     * @param shashaUserAchieve 用户获得奖励记录
     * @return 结果
     */
    @Override
    public int insertShashaUserAchieve(ShashaUserAchieve shashaUserAchieve)
    {
        return shashaUserAchieveMapper.insertShashaUserAchieve(shashaUserAchieve);
    }

    /**
     * 修改用户获得奖励记录
     * 
     * @param shashaUserAchieve 用户获得奖励记录
     * @return 结果
     */
    @Override
    public int updateShashaUserAchieve(ShashaUserAchieve shashaUserAchieve)
    {
        return shashaUserAchieveMapper.updateShashaUserAchieve(shashaUserAchieve);
    }

    /**
     * 批量删除用户获得奖励记录
     * 
     * @param ids 需要删除的用户获得奖励记录主键
     * @return 结果
     */
    @Override
    public int deleteShashaUserAchieveByIds(Long[] ids)
    {
        return shashaUserAchieveMapper.deleteShashaUserAchieveByIds(ids);
    }

    /**
     * 删除用户获得奖励记录信息
     * 
     * @param id 用户获得奖励记录主键
     * @return 结果
     */
    @Override
    public int deleteShashaUserAchieveById(Long id)
    {
        return shashaUserAchieveMapper.deleteShashaUserAchieveById(id);
    }

    @Override
    public List<ShashaRewardNameUrlCount> selectShashaUserAchieveByUserId(Long userId) {
        return shashaUserAchieveMapper.getUserRewardsByUserId(userId);
    }
}
